package com.zoo.diannaopeijian.controller.component;

import com.zoo.diannaopeijian.comm.filter.FilterUtil;
import com.zoo.diannaopeijian.controller.BaseController;
import com.zoo.diannaopeijian.domain.Component;
import com.zoo.diannaopeijian.domain.ComponentParameter;
import com.zoo.diannaopeijian.service.ComponentParameterService;
import com.zoo.diannaopeijian.service.ComponentService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by zx583 on 2018-01-15.
 */
@RestController
@RequestMapping("/component/parameter")
public class ComponentParameterController extends BaseController {
    @Resource
    private ComponentParameterService componentParameterService;

    @RequestMapping("/getComponentParameter")
    public List<ComponentParameter> getComponentParameter(ComponentParameter componentParameter) {
        return componentParameterService.getComponentParameter(componentParameter);
    }

    @RequestMapping("/addComponentParameter")
    public String addComponentParameter(ComponentParameter componentParameter) {
        return componentParameterService.addComponentParameter(componentParameter) ? success : fail;
    }

    @RequestMapping("/deleteComponentParameter")
    public String deleteComponentParameter(Integer componentparameterid) {
        return componentParameterService.deleteComponentParameter(componentparameterid) ? success : fail;
    }

    @RequestMapping("/updateComponentParameter")
    public String updateComponentParameter(ComponentParameter componentParameter) {
        return componentParameterService.updateComponentParameter(componentParameter) ? success : fail;
    }
}
